package com.xy.service.impl;

import com.xy.dao.RoleDao;
import com.xy.model.Role;
import com.xy.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

@Service
@Transactional
public class RoleServiceImpl implements RoleService {
    @Autowired
    RoleDao roleDao;
    public Set<String> getRoles(Integer userid) {
        return roleDao.getRoles(userid);
    }

    public Set<String> getRolesAll() {
        return roleDao.getRolesAll();
    }

    public List<Role> getRolesForRole(Integer userid) {
        return roleDao.getRolesForRole(userid);
    }

    public int addRole(Role role) {
        return roleDao.addRole(role);
    }

    public int delRole(Integer id) {
        return roleDao.delRole(id);
    }
}
